package cn.tedu.storage.mapper;

import cn.tedu.storage.entity.Storage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface StorageMapper extends BaseMapper<Storage> {
    void decrease(Long productId, Integer count);

    //查询库存，用来判断是否有足够库存
    Storage findByProductId(Long productId);
    //可用residue ---> 冻结frozen
    void updateResidueToFrozen(Long productId, Integer count);
    //冻结frozen ---> 已使用used
    void updateFrozenToUsed(Long productId, Integer count);
    //冻结frozen ---> 可用residue
    void updateFrozenToResidue(Long productId, Integer count);
}
